﻿using Castle.DynamicProxy;
using System;
using System.Collections.Generic;
using System.Text;

namespace PlutoStudio.Aspects
{
    internal class TypeInterceptorMap
    {
        public Type Type { get; private set; }

        public List<Type> InterceptorTypes { get; private set; } = new List<Type>();

        public void AddInterceptor(Type interceptorType)
        {
            InterceptorTypes.Add(interceptorType);
        }

        internal TypeInterceptorMap(Type type)
        {
            Type = type;
        }

        public override int GetHashCode()
        {
            return Type.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            var other = obj as TypeInterceptorMap;
            if (other==null)
            {
                return false;
            }
            return other.Type.Equals(Type);
        }
    }
}
